import QtQuick 2.4

import QtQuick.Layouts 1.1
import QtQuick.Controls 1.4
import Qt.labs.controls 1.0
import QtQml.Models 2.2
import "../js/ExamProgressManageNavigator.qml.js" as Jit
import "../template" as Tm
import fan.qt.complex 1.0 as Lex

Tm.Navigator {
    id: nav
    title: "考试进度"
    Component.onCompleted: Jit.query()
    property var exampsData: []
    ColumnLayout {
        id: col
        anchors.margins: 9

        GroupBox {

            ButtonGroup {
               id: buttonGroup
              onCheckedButtonChanged: Jit.currentChanged()
            }
            RowLayout {
                RadioButton{
                   ButtonGroup.group: buttonGroup
                   property int index: 0
                    text:"科目一"
                    checked: true
                }
                RadioButton{
                    ButtonGroup.group: buttonGroup
                    property int index: 1
                    text:"科目二"
                }
                RadioButton{
                    ButtonGroup.group: buttonGroup
                    property int index: 2
                    text:"科目三"
                }
                RadioButton{
                    ButtonGroup.group: buttonGroup
                    property int index: 3
                    text:"科目四"
                }
            }
        }

        ListView {
            id: listView
            Layout.fillHeight: true
            Layout.fillWidth: true
            model: ListModel{id: model}
            delegate: ItemDelegate{
                width: listView.width
                height: implicitHeight * 3
                RowLayout {
                    anchors.fill: parent
                    anchors.margins: 9
                    Image {
                        Layout.alignment: Qt.AlignVCenter
                        sourceSize: Qt.size(100,100)
                        source: "http://" + Lex.G.SERVER + image
                    }
                    ColumnLayout {
                        Layout.fillHeight: true
                        Layout.fillWidth: true
                        Layout.alignment: Qt.AlignLeft
                        spacing: 9
                        Label {
                            text: "姓名：" + name + " 电话：" + mobile

                            elide: Text.ElideRight
                            color: "dimgray"
                        }


                        Label {
                            text:  "邮箱：" + mail

                            verticalAlignment: Text.AlignVCenter
                        }

                        Label {
                            text:  "地址：" + address

                            verticalAlignment: Text.AlignVCenter
                        }

                        Label {
                            text:  nextExamp
                            color: "red"

                            verticalAlignment: Text.AlignVCenter
                        }
                    }

                }
            }
        }
    }
}
